# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=curaengine
# If you plan to upgrade curaengine, libarcus probably needs to be upgraded too
pkgver=5.2.2
pkgrel=9
pkgdesc="3D slicer engine"
url="https://github.com/Ultimaker/CuraEngine"
license="AGPL-3.0-or-later"
arch="all !x86" # test suite fails on x86
makedepends="
	boost-dev
	clipper-dev
	cmake
	libarcus-dev
	protobuf-dev
	range-v3-dev
	rapidjson-dev
	samurai
	spdlog-dev
	stb
	"
source="https://github.com/Ultimaker/CuraEngine/archive/$pkgver/CuraEngine-$pkgver.tar.gz
	cmake.patch
	cmake-helpers.patch
	CuraEngine-5.3.0-fmt10.patch
	"
options="net !check" # Required to download dependencies, TODO: stop network usage
builddir="$srcdir/CuraEngine-$pkgver"

build() {
	cmake -G Ninja -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=Release
	cmake --build build
}

check() {
	cmake --build build --target test
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a5d1e23829b05b88e9eeed98a107a9375301ba6814dc0681ed98d6ce8f69892146877609a598d6f4d773931e5c96d62aec60fbcf04b9eaefa849a489277b62ff  CuraEngine-5.2.2.tar.gz
0c1c1b8dd258fedd68dd4dbdc86b71d99e030633e636d9b0b04bd34d3aa0ed56b6151cbaaead6758a6ea155dd4b23dbc04a409dd1223edeae9b8104cae6d28c2  cmake.patch
3102f984decaa84174a8757baeda61eec11fa0ca7481e530f0370d31fa7728c8a4293b0e3d25f7472c0e145b6c2e3cda6850bc4b691e4d118a235d022cbe8da7  cmake-helpers.patch
9b186cb64831e5b2e89168e6390ec28611b5f90e227a7189d9f4e8c5d2a441f975c3d37bef5a4670504a0a2d2bfe968d84fa006a9bb24f8637906dad01991198  CuraEngine-5.3.0-fmt10.patch
"
